package CarLease.entity;

public abstract class Car {
    //汽车类：车牌号、型号、颜色、价格、排量属性
    private String carId;
    private String model;
    private String color;
    private double price;
    private double displacement;
    private boolean rented;

    public Car(String carId, String model, String color, double price, double displacement) {
        this.carId = carId;
        this.model = model;
        this.color = color;
        this.price = price;
        this.displacement = displacement;
    }

    public String getModel() {
        return model;
    }

    public String getCarId() {
        return carId;
    }

    public String getColor() {
        return color;
    }

    public double getPrice() {
        return price;
    }

    public double getDisplacement() {
        return displacement;
    }

    // 获取出租状态
    public boolean isRented() {
        return rented;
    }

    // 设置出租状态
    public void setRented(boolean rented) {
        this.rented = rented;
    }

    //定义一个抽象方法，用于计算汽车租赁费用
    public abstract double calculateRent(int day);

    protected abstract void showSpecialInfo();

    //定义一个方法，显示汽车信息
    public void showInfo() {
        System.out.println("汽车信息：");
        System.out.println("车牌号：" + carId);
        System.out.println("汽车型号：" + model);
        System.out.println("汽车颜色：" + color);
        System.out.println("汽车价格：" + price);
        System.out.println("汽车排量：" + displacement);
        showSpecialInfo();
    }

}
